package com.jrtc.backend.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jrtc.base.config.dto.ResultDTO;
import com.jrtc.base.config.dto.ResultDTOBuilder;
import com.jrtc.base.entity.bo.Department;
import com.jrtc.base.entity.vo.FingerFuckVo;
import com.jrtc.service.DepartmentService;
import com.jrtc.service.FingerFuckService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("fingerFuck")
public class FingerFuckController {
    /**
     * 服务对象
     */
    @Resource
    private FingerFuckService fingerFuckService;

    /**
     * 患者获取手指操信息
     * */
    @PostMapping("/fingerFuck")
    public ResultDTO fingerFuck(@RequestBody Map<String, Object> map){
        String idCard = map.get("idCard").toString();
        String type = map.get("type").toString();
        List<FingerFuckVo> fingerFuckVos;
        try {
            fingerFuckVos = fingerFuckService.fingerFuck(idCard, type);
        } catch (Exception e){
            return ResultDTOBuilder.failure(e.getMessage());
        }

        return ResultDTOBuilder.success(fingerFuckVos);
    }
}